﻿<div>

<script type="text/javascript">
    $(function () {
        $("#t1").datagrid({
            title: 'test datagrid',
            width: 1200,
            height: 400,
            method: "get",
            url: "datagrid/datagrid-data.json",
            idField: 'ID',
            remoteSort: false,
            frozenColumns: [[
                { field: 'ck', checkbox: true },
                { field: 'ID', title: 'ID', width: 80, sortable: true }
            ]],
            columns: [[
                { field: 'Code', title: '编号(Code)', width: 120, sortable: true },
                { field: 'Name', title: '名称(Name)', width: 140, sortable: true },
                { field: 'Age', title: '年龄(Age)', width: 120, sortable: true },
                { field: 'Height', title: '身高(Height)', width: 140, sortable: true },
                { field: 'Weight', title: '体重(Weight)', width: 140, sortable: true },
                { field: 'CreateDate', title: '创建日期(CreateDate)', width: 180, sortable: true },
                { field: 'undefined', title: '测试(不存在的字段)', width: 150 }
            ]],
            enableHeaderClickMenu: true,        //此属性开启表头列名称右侧那个箭头形状的鼠标左键点击菜单
            enableHeaderContextMenu: true,      //此属性开启表头列名称右键点击菜单
            enableRowContextMenu: false
        });
    });
</script>

<h2>jEasyUI DataGrid Extensions - 表头右键菜单</h2>
<p>该部分扩展由文件 jeasyui.extensions.datagrid.js 实现。</p>
<hr />
<p>用鼠标右键点击此表格表头列试试看</p>
<table id="t1"></table>

</div>